Change allowed_instance_types to accept list instead of space-delimit…#46141
Merged
PratibhaShrivastav18 merged 6 commits intoAzure:mainfrom Apr 9, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates allowed_instance_types to be represented as a YAML/SDK list (rather than a single space-delimited string), aligning schema + entity serialization with the service’s array shape.
Changes:
- Updated
DeploymentTemplateSchemato parseallowed_instance_typesasList[str]. - Updated
DeploymentTemplateto typeallowed_instance_typesasOptional[List[str]]and to serialize it directly asallowedInstanceTypes. - Removed string-splitting conversion in
DeploymentTemplateOperations._convert_dict_to_deployment_template, and updated one unit test to use a list.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sdk/ml/azure-ai-ml/tests/deployment_template/unittests/test_deployment_template.py | Updates initialization assertion to use list form for allowed_instance_types. |
| sdk/ml/azure-ai-ml/azure/ai/ml/operations/_deployment_template_operations.py | Stops converting string allowed_instance_types into a list during dict-to-entity conversion. |
| sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_template.py | Changes allowed_instance_types typing to List[str] and passes through list directly in REST serialization. |
| sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/template/deployment_template.py | Changes marshmallow schema field type from Str to List(Str). |
sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_template.py
Show resolved
Hide resolved
sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_template.py
Show resolved
Hide resolved
sdk/ml/azure-ai-ml/azure/ai/ml/operations/_deployment_template_operations.py
Show resolved
Hide resolved
sdk/ml/azure-ai-ml/tests/deployment_template/unittests/test_deployment_template.py
Show resolved
Hide resolved
bfbd7cd to
31270ba
Compare
31270ba to
80a5edd
Compare
sdk/ml/azure-ai-ml/azure/ai/ml/operations/_deployment_template_operations.py
Show resolved
Hide resolved
kshitij-microsoft
approved these changes
Apr 8, 2026
achauhan-scc
approved these changes
Apr 9, 2026
kshitij-microsoft
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
allowed_instance_types— Breaking ChangeCLI (YAML input)
Before:
After:
SDK
Before:
After:
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines